places view: fix a crash in finalize
authorMatthias Clasen <mclasen@redhat.com>
Mon, 21 Sep 2015 23:41:34 +0000 (19:41 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 21 Sep 2015 23:42:28 +0000 (19:42 -0400)
Fix a GtkPlacesView crash in the test suite, _again_.

gtk/gtkplacesview.c

index 5fa3c39efa226668a22c417385620eb6c4fe4dc3..8fc6ec7f8b4ebb3efe8b8e492e6d37e1a655d941 100644 (file)
@@ -960,7 +960,6 @@ network_enumeration_next_files_finished (GObject      *source_object,
   priv = gtk_places_view_get_instance_private (view);
   error = NULL;
 
-  gtk_places_view_set_fetching_networks (view, FALSE);
   detected_networks = g_file_enumerator_next_files_finish (G_FILE_ENUMERATOR (source_object),
                                                            res, &error);
 
@@ -973,16 +972,18 @@ network_enumeration_next_files_finished (GObject      *source_object,
     }
   else
     {
+      gtk_places_view_set_fetching_networks (view, FALSE);
       populate_networks (view, G_FILE_ENUMERATOR (source_object), detected_networks);
 
       g_list_free_full (detected_networks, g_object_unref);
     }
 
-    /* avoid to update widgets if the operation was cancelled in finalize */
-    if (priv->listbox != NULL)
+  /* avoid to update widgets if the operation was cancelled in finalize */
+  if (priv->listbox != NULL)
+    {
       update_network_state (view);
-
-  update_loading (view);
+      update_loading (view);
+    }
 }
 
 static void